<template>
  <div>
    <div class="page-content container" v-if="show">
      <div class="row detail-box">
        <div class="col-sm-9">
          <div class="content">
            <div class="info" v-if="info">
              <div class="row">
                <div class="col-sm-4">
                  <div class="">
                    <img class="img-thumbnail" width="100%" :src="info.cover" />
                  </div>
                </div>
                <div class="col-sm-8">
                  <div class="title">
                    <a href="#" class="content-type">歌单</a><h2>{{ info.title }}</h2>
                  </div>
                  <div class="user">
                    <a href="#" class="head"><img src="/static/img/a8.jpg" class="img-circle"></a>
                    <a href="#" class="nickname">{{ user.name }}</a> <i class="glyphicon glyphicon-fire" style="color: red;"></i>
                    <span class="time">{{ info.created_at }} 创建</span>
                  </div>
                  <div class="play-btn">
                    <button class="btn btn-danger"><i class="glyphicon glyphicon-play-circle"></i> 播放 </button>
                    <button class="btn btn-default"><i class="glyphicon glyphicon-folder-open"></i> 收藏 </button>
                    <button class="btn btn-default"><i class="glyphicon glyphicon-download-alt"></i> 下载 </button>
                    <button class="btn btn-default"><i class="glyphicon glyphicon-share"></i> 分享 </button>
                    <button class="btn btn-default"><i class="glyphicon glyphicon-comment"></i> (999+) </button>
                  </div>
                  <div class="tag" v-if="tags.length">
                    <span>标签:</span>
                    <span v-for="tag in tags"><a href="#">{{ tag.title }}</a></span>
                  </div>
                  <div class="desc">
                    <span>介绍:</span>
                    <span> {{ info.desc }}
                    </span>
                  </div>
                </div>
              </div>
            </div>
            <div class="list">
              <div class="list-title clearfix">
                <h4 class="pull-left">
                  <span>歌曲列表</span><small>{{ musics.length }}首歌</small>
                </h4>
                <div class="play-num pull-right">
                  播放次数: <span>125678</span> 次
                </div>
              </div>
              <div class="list-content">
                <table class="list-table table table-striped">
                  <thead>
                  <tr>
                    <th></th>
                    <th>标题</th>
                    <th>时长</th>
                    <th>歌手</th>
                    <th>专辑</th>
                  </tr>
                  </thead>
                  <tbody>

                  <tr v-if="musics.length != 0" v-for="(music,index) in musics">
                    <td width="10%">
                      <span>{{ index+1 }}</span>
                      <a href="#"><span class="pull-right"><i class="glyphicon glyphicon-play-circle" style="font-size:18px;"></i></span></a>
                    </td>
                    <td width="40%">
                      <a href="#">{{ music.title }}</a><span v-if="music.intro">-{{ music.intro }}</span>
                    </td>
                    <td width="15%"><span>{{ music.time }}</span></td>
                    <td width="15%"><a href="#">{{ music.singer.name }}</a></td>
                    <td width="20%"><a href="#">{{ music.album.title }}</a></td>
                  </tr>
                  
                  </tbody>
                </table>
              </div>
            </div>
            <!--评论-->

            <m-comment from-type="playlist" :from-id="this.$route.params.id"></m-comment>

            <!--评论-->
          </div>
        </div>
        <div class="col-sm-3">
          <div class="aside-box">
            <div class="box-title">喜欢这个歌单的人</div>
            <div class="box-list">
              <ul class="lump">
                <li><a href="#"><img src="http://p1.music.126.net/mwtmYN5EJlmYjEej_oHoWw==/19195273997735719.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/ongIzxAXo8uR0REQd2wTiQ==/19003958974503061.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/cav3lux8oeqoLynZ_uYZ2A==/18773061534482589.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/piyNARZ00KBJpTPoVC04Sw==/19233756904706999.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/JTprxiAd0iFWkkMqstykkg==/18641120139150446.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/Ws4DLGQLGkq4B0OgjJ5gqA==/18825838092613228.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/mwtmYN5EJlmYjEej_oHoWw==/19195273997735719.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/ongIzxAXo8uR0REQd2wTiQ==/19003958974503061.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/cav3lux8oeqoLynZ_uYZ2A==/18773061534482589.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/piyNARZ00KBJpTPoVC04Sw==/19233756904706999.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/JTprxiAd0iFWkkMqstykkg==/18641120139150446.jpg?param=60y60"></a></li>
                <li><a href="#"><img src="http://p1.music.126.net/Ws4DLGQLGkq4B0OgjJ5gqA==/18825838092613228.jpg?param=60y60"></a></li>
              </ul>
            </div>
          </div>

          <div class="aside-box">
            <div class="box-title">热门推荐</div>
            <div class="box-list">
              <ul class="list">
                <li>
                  <a href="#" class="cover">
                    <img src="http://p1.music.126.net/mwtmYN5EJlmYjEej_oHoWw==/19195273997735719.jpg?param=60y60">
                  </a>
                  <div class="info">
                    <a href="#" class="title">
                      回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车
                    </a>
                    <div class="user">by <a href="#">小天菊次郎</a></div>
                  </div>
                </li>

                <li>
                  <a href="#" class="cover">
                    <img src="http://p4.music.126.net/1VJ_a38uE-MQI_8CQd4-ow==/109951162869533779.jpg?param=200y200">
                  </a>
                  <div class="info">
                    <a href="#" class="title">
                      回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车
                    </a>
                    <div class="user">by <a href="#">小天菊次郎</a></div>
                  </div>
                </li>

                <li>
                  <a href="#" class="cover">
                    <img src="http://p1.music.126.net/mwtmYN5EJlmYjEej_oHoWw==/19195273997735719.jpg?param=60y60">
                  </a>
                  <div class="info">
                    <a href="#" class="title">
                      回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车
                    </a>
                    <div class="user">by <a href="#">小天菊次郎</a></div>
                  </div>
                </li>

                <li>
                  <a href="#" class="cover">
                    <img src="http://p4.music.126.net/1VJ_a38uE-MQI_8CQd4-ow==/109951162869533779.jpg?param=200y200">
                  </a>
                  <div class="info">
                    <a href="#" class="title">
                      回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车
                    </a>
                    <div class="user">by <a href="#">小天菊次郎</a></div>
                  </div>
                </li>

                <li>
                  <a href="#" class="cover">
                    <img src="http://p1.music.126.net/mwtmYN5EJlmYjEej_oHoWw==/19195273997735719.jpg?param=60y60">
                  </a>
                  <div class="info">
                    <a href="#" class="title">
                      回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车回忆是一抹缱绻，是单车
                    </a>
                    <div class="user">by <a href="#">小天菊次郎</a></div>
                  </div>
                </li>

              </ul>
            </div>
          </div>

        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { fetchPlaylistDetail } from '../../service'
import mComment from '../../components/Comment'
export default {
  components: {
    mComment
  },
  data () {
    return {
      info: {},
      user: {},
      tags: [],
      musics: [],
      show: false
    }
  },
  methods: {
  },
  mounted () {
    const id = this.$route.params.id
    fetchPlaylistDetail(id).then((data) => {
      this.info = data
      this.user = data.user
      this.tags = data.tags
      this.musics = data.musics
      this.show = true
    })
  },
  created () {
  }
}
</script>
<style scoped>
  .detail-box{
    margin-top: 20px;
  }
  .content{
    background: #fff;
    padding: 30px;
  }
  .info{
    
  }
  .info .title h2{
    margin:0;
    font-size: 22px;
  }
  .info .user{
    margin-top: 10px;
  }
  .info .user .head img{
    width: 30px;
    height: 30px;
    margin-right: 5px;
  }
  .info .user .nickname{
    color:#0c73c2;
    font-size: 10px;
  }
  .info .user .time{
    font-size: 10px;
    color: #999;
    margin-left: 10px;
  }
  .info .play-btn{
    margin-top: 20px;
  }
  .info .tag{
    margin-top: 20px;
  }
  .info .tag span{
    color: #666;
    font-size: 12px;
  }
  .info .tag a{
    color: #666;
    padding: 5px 10px;
    font-size: 12px;
    border: solid 1px #666;
    border-radius: 15px;
    margin-left: 10px;
  }
  .info .tag a:hover{
    text-decoration: none;
  }
  .info .desc{
    margin-top: 10px;
  }
  .info .desc span{
    color: #666;
    font-size: 12px;
    margin-right: 10px;
  }
  

</style>
